<?php
if (!defined('BASEPATH'))
    exit('no direct script allowed asshole!!');
$this->load->helper('html');
?>



<!-- JavaScript -->
<script type="text/javascript" src="<?= base_url() ?>js/wufoo.js"></script>
<script src="<?= base_url() ?>js/jscal2.js"></script>
<script src="<?= base_url() ?>js/lang/en.js"></script>

<!-- CSS -->
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/form/form.css" media="screen, tv, projection" title="Default" />
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/jscal2.css" />
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/border-radius.css" />
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/steel/steel.css" />

 

<div id="container">
    <fieldset class="fieldset">
        <legend class="legend">

		<?
		if ($status == "detail") {
		echo '| Detail Data Warranty |</legend>';
		} else if ($status == "edit") {
		echo '| Edit Data Warranty |</legend>';
		}
		else {
		echo '| Form Data Warranty |</legend>';
		}
		?>

        <div id="contentform" style="border:solid thin #BBBBBB; height:350px; background-color:#F9F9F9; -moz-border-radius: 5px;  padding-top:10px; padding-bottom:0.3px; margin-right:100px; margin-left:100px;">

            <!-- Start value -->
            <?
            //Setting Value Jika Prosedur yang dilakukan adalah prosedur input biasa.
            $value = array(
                'id_warranty' => "",
                'nama_warranty' => "",
                'tanggal_warranty' => "",
                'keterangan' => "",
				'id_ship' => "",
				'act_form' => "warranty/upload/"
            );
			
            //Setting Value pada form Jika melakukan prosedur Edit terhadap data tertentu.
            if ($status == "edit") {
                $value['id_warranty'] = $id_warranty;
                $value['nama_warranty'] = $nama_warranty;
                $value['tanggal_warranty'] = $tanggal_mulai_warranty;
                $value['keterangan'] = $keterangan;
				$value['id_ship'] = $id_ship;
				$value['act_form'] = "warranty/update/" . $value['id_warranty'];
            }//end if
            ?>

            <?= form_open_multipart($value["act_form"]); ?>
           
            <!-- End value -->

            <table width="847" border="0" bordercolor="#F0F0F0">
                <tr>
                    <td width="905" height="150">
                        <form id="form1" name="form1" method="post">
                            <div align="center">
                                <table width="850" border="0">                                 
								
									<tr>
                                        <td width="180">Nama Klaim</td>
                                        <td width="208"><input name="nama_warranty" type="text" size="50" value="<?= $value['nama_warranty'] ?>"/></td>
                                        <td><? echo form_error('nama_warranty');?></td>
                                    </tr>                                  
									<tr>
                                        <td width="180">Tanggal Klaim</td>
                                        <td width="208"><input id="tanggal_warranty" name="tanggal_warranty" readonly="true" size="20" value="<?= $value['tanggal_warranty'] ?>"/><input id="f_btn1" type="button" name="Submit22" value="" onclick="tanggal_warranty.value=''"/></td>
										<td><? echo form_error('tanggal_warranty');?></td>
									</tr>									
									<tr>
                                        <td>Nama Kapal yang diklaim</td>
                                		<td>
										<?
											$options[Null] = "-- Daftar Kapal --";
											foreach ($ship->result() as $row)
											{
												$options[$row->id_ship] = $row->name_of_ship;
											}
											echo form_dropdown('id_ship', $options, $value["id_ship"], 'class="field select"');
											if ($status=="detail")
											{
												echo form_dropdown('id_ship', $options, $value["id_ship"], 'class="field select" id="id_ship"');
											}
										?>
										
										</td>										
                                        <td><? echo form_error('id_ship');?></td>
                                    </tr>
									<tr>
									 <tr>
                                        <td width="80">Keterangan</td>
                                        <td width="208"><input name="keterangan" type="text" size="50" value="<?= $value['keterangan'] ?>"/></td>
										<td><? echo form_error('keterangan');?></td>
									</tr>
									
								                                  
                                    <tr>
                                        <td height="28">&nbsp;</td>
                                        <td>
                                            <div align="left">
                                                <input type="submit" name="Submit" value="Simpan" />
												<a href="<?php echo site_url('warranty/index') ?>">
												<input type="button" value="Kembali" />
												</a>

												
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </form>
                        <p align="center">&nbsp;</p></td></tr>
            </table>
        </div>
        <p>&nbsp;</p>
		
		<script type="text/javascript">//<![CDATA[

      var cal = Calendar.setup({
          onSelect: function(cal) { cal.hide() }
      });
      cal.manageFields("f_btn1", "tanggal_warranty", "%Y-%m-%d");
	  // cal.manageFields("f_btn2", "tanggal_selesai_warranty", "%Y-%m-%d");

    //]]></script>
		
    </fieldset>
</div>
<p>
    <!--container-->
</p>
<p>&nbsp; </p>

